package com.dcits.servicemanagement.common.utils;

import com.dcits.servicemanagement.common.entity.JsonResult;
import com.dcits.servicemanagement.common.enums.ResultCode;

/**
 * @Classname ResultTool
 * @Description 返回体构造工具
 * @Version 1.0.0
 * @Date 2022/4/22 17:06
 * @Created by hejle
 */
public class ResultTool {
    public static JsonResult success() {
        return new JsonResult(true);
    }

    public static <T> JsonResult<T> success(T data) {
        return new JsonResult(true, data);
    }

    public static JsonResult fail() {
        return new JsonResult(false);
    }

    public static JsonResult fail(ResultCode resultEnum) {
        return new JsonResult(false, resultEnum);
    }

}
